[auditbeat] Allow memfd_create(2) in seccomp for add_session_metadata…#41297
Merged
[auditbeat] Allow memfd_create(2) in seccomp for add_session_metadata…#41297
Conversation
…@ebpf
Quark was falling back into kprobe since ebpf would fail with EPERM at
memfd_create(2).
```
$ strace -f auditbeat ....
[pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted)
```
With this my test case where kprobe is disabled now uses ebpf when I select
backend "auto", before it was falling back to procfsprovider.
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Contributor
|
|
mjwolf
approved these changes
Oct 17, 2024
Contributor
|
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
haesbaert
added a commit
to elastic/quark
that referenced
this pull request
Oct 18, 2024
The whole idea of "the user should not even know which backend is being used", worked a bit too much. This was prompted by a bug in beats where seccomp was blocking a syscall needed for EBPF, and so it fell back to kprobe all the time and the user had no proper way to notice this. Related to elastic/beats#41297 Purposedly stashed this into stats to make it hard to retrieve from quark.c, if we start doing `if (qq->backend == QQ_EBPF)` we lost the war.
mergify bot
pushed a commit
that referenced
this pull request
Oct 18, 2024
…@ebpf (#41297) Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2). ``` $ strace -f auditbeat .... [pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted) ``` With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider. (cherry picked from commit 6766cfa)
mergify bot
pushed a commit
that referenced
this pull request
Oct 18, 2024
…@ebpf (#41297) Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2). ``` $ strace -f auditbeat .... [pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted) ``` With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider. (cherry picked from commit 6766cfa)
belimawr
pushed a commit
to belimawr/beats
that referenced
this pull request
Oct 18, 2024
…@ebpf (elastic#41297) Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2). ``` $ strace -f auditbeat .... [pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted) ``` With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider.
haesbaert
added a commit
to elastic/quark
that referenced
this pull request
Oct 21, 2024
The whole idea of "the user should not even know which backend is being used", worked a bit too much. This was prompted by a bug in beats where seccomp was blocking a syscall needed for EBPF, and so it fell back to kprobe all the time and the user had no proper way to notice this. Related to elastic/beats#41297 Purposedly stashed this into stats to make it hard to retrieve from quark.c, if we start doing `if (qq->backend == QQ_EBPF)` we lost the war.
haesbaert
added a commit
that referenced
this pull request
Oct 28, 2024
…@ebpf (#41297) (#41316) Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2). ``` $ strace -f auditbeat .... [pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted) ``` With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider. (cherry picked from commit 6766cfa) Co-authored-by: Christiano Haesbaert <haesbaert@elastic.co>
haesbaert
added a commit
that referenced
this pull request
Oct 28, 2024
…@ebpf (#41297) (#41317) Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2). ``` $ strace -f auditbeat .... [pid 2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted) ``` With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider. (cherry picked from commit 6766cfa) Co-authored-by: Christiano Haesbaert <haesbaert@elastic.co>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…@ebpf
Quark was falling back into kprobe since ebpf would fail with EPERM at memfd_create(2).
With this my test case where kprobe is disabled now uses ebpf when I select backend "auto", before it was falling back to procfsprovider.
Proposed commit message
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksI have added an entry inCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Change QQ_ALL_BACKENDS to QQ_EBPF and kerneltracingprovider will fallback into procfs, with the fix it doesn't.